-
Notifications
You must be signed in to change notification settings - Fork 8
start of gliffy #232
start of gliffy #232
Conversation
| # Capture tags for exclusion check | ||
| tags = {tag['Key']: tag['Value'] for tag in instance.get('Tags', [])} | ||
|
|
||
| resources["ec2_instances"].append({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the private ip (v4) to this please
| # Capture tags for exclusion check | ||
| tags = {tag['Key']: tag['Value'] for tag in instance.get('Tags', [])} | ||
|
|
||
| resources["ec2_instances"].append({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private ip here too
| logger.warning(f"Error getting tags for RDS instance {instance['DBInstanceIdentifier']}: {tag_e}") | ||
|
|
||
| resources["rds_instances"].append({ | ||
| "id": instance['DBInstanceIdentifier'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add rds dns name here (and below in the Next processing)
| # Capture tags for exclusion check | ||
| cluster_tags = cluster_info['cluster'].get('tags', {}) | ||
|
|
||
| resources["eks_clusters"].append({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add eks version if possible (here and below)
|
|
||
| return resources | ||
|
|
||
| def shutdown_ec2_instances(credentials, instances, account_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the output in skipping, add the Name tag
| timestamp = datetime.datetime.now().isoformat() | ||
|
|
||
| # Tag the instance before stopping | ||
| logger.info(f"Tagging EC2 instance {instance['id']} with {STOP_TAG}={timestamp}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add Name tag value to the log
| ) | ||
|
|
||
| # Stop the instance | ||
| logger.info(f"Stopping EC2 instance {instance['id']} in region {region}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add Name tag and ip to this log line
| logger.info(f"Saving original ASG {asg_name} sizes: min={current_min_size}, desired={current_desired_size}") | ||
| autoscaling_client.create_or_update_tags( | ||
| Tags=[ | ||
| { | ||
| 'ResourceId': asg_name, | ||
| 'ResourceType': 'auto-scaling-group', | ||
| 'Key': TAG_KEY_ORIGINAL_MIN_SIZE, | ||
| 'Value': str(current_min_size), | ||
| 'PropagateAtLaunch': False | ||
| }, | ||
| { | ||
| 'ResourceId': asg_name, | ||
| 'ResourceType': 'auto-scaling-group', | ||
| 'Key': TAG_KEY_ORIGINAL_DESIRED_SIZE, | ||
| 'Value': str(current_desired_size), | ||
| 'PropagateAtLaunch': False | ||
| } | ||
| ] | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing max size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A pile of recommedations. Basically, for output of log lines include
- ec2: ip, name tag
- rds: name tag, dns fqdn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving so we can potentially use it, and then work further changes and enhancements
|
moving forward |
So we can collaborate via comments.